package test;

import static org.junit.Assert.*;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import CDIO2.Konto;

public class JUnitTestKonto {
	Konto test = new Konto();
	
	@Before
	public void setup(){
		System.out.println("-preconditions set-");
		test.setPoints(100);
		System.out.println("konto: "+ test.getPoints());
	}
	
	@After
	public void eval(){
		System.out.println("Points after test: " +test.getPoints());
	}

	@Test
	public void testWithDraw1() {
		int expectedValue = 0;
		test.withdrawPoints(1000);
		int actualValue = test.getPoints();
		assertEquals(expectedValue, actualValue);
	}
	
	@Test
	public void testWithDraw2() {
		int expectedValue = 0;
		test.withdrawPoints(-200);
		int actualValue = test.getPoints();
		assertEquals(expectedValue, actualValue);
	}
	
	@Test
	public void testNegativeAdd(){
		int expectedValue = 201;
		test.addPoints(-101);
		int actualValue = test.getPoints();
		assertEquals(expectedValue, actualValue);
	}
	
	
	
}
